package com.xinyu.maker.cli.command;

import cn.hutool.core.util.ReflectUtil;
import com.xinyu.maker.model.DataModel;
import picocli.CommandLine;

import java.lang.reflect.Field;

/**
 * config 子命令
 * 输出允许用户传入的动态参数的信息
 *
 * @author: Wuxinyu
 * @date: 2024/5/19-05-19-16:25
 * @description: com.xinyu.cli.command
 * @version: 1.0
 */
@Deprecated
@CommandLine.Command(name = "config", description = "查看参数信息", mixinStandardHelpOptions = true)
public class ConfigCommand implements Runnable {
    @Override
    public void run() {
        // 实现config命令的逻辑
        System.out.println("查看参数信息");

        Field[] fields = ReflectUtil.getFields(DataModel.class);
        // 打印每个字段的信息
        for (Field field : fields) {
            System.out.println("字段名称：" + field.getName());
            System.out.println("字段类型：" + field.getType());
            System.out.println("-----");
        }
    }
}
